begintownscript;

variables;
 
 int i;
short choice;
 body;
 
beginstate INIT_STATE;
 
set_name(27,"Miner");
 
set_name(28,"Miner");
 
set_name(24,"Innkeeper");
 
set_name(22,"Mayor Rupp");
 
set_name(29,"Captain Rupp");
 
set_name(20,"Jailed Thief");
 
set_name(19,"Jailed Thief");
 
set_name(32,"Worker");
 
set_name(33,"Worker");
 
set_level(22,100);
 
set_name(26,"Geothisth");
 
set_name(25,"Drunk Miner");
 
set_crime_tolerance(1);
if (get_flag(0,20) > 2){ erase_char(22); } break;
 
beginstate EXIT_STATE;text_bubble_on_char(19,"Go away!");
text_bubble_on_char(20,"I'm innocent!");
text_bubble_on_char(29,"This crazy world...");
text_bubble_on_char(24,"Our rooms are excellent!"); 
text_bubble_on_char(35,"Woohoo!");
 break;
 
beginstate START_STATE;
 
if (get_crime_level() > 0) {
   message_dialog("You commited a crime, and people here don't appreciate that.","The guards kill you.");
  
i = 0;
    while(i < 4) { 
       kill_char(i,3,0); 
      
i = i + 1; 
    }
} break;
beginstate 10;
 if (get_flag(0,10) == 0) { activate_hidden_group(1);
 
set_flag(0,10,1);
 } break;
 
beginstate 11;
 if (get_flag(0,10) == 1) { message_dialog("You see a man put a knife to the mayors throat.",""); pause(3);
 
text_bubble_on_char(23,"Ha ha ha!");
 force_instant_terrain_redraw();
 
pause(8);
 erase_text_bubbles();
 
pause(3);
 text_bubble_on_char(23,"Now to...w");
 force_instant_terrain_redraw();
 pause(8);
 erase_text_bubbles();
 pause(3);
 text_bubble_on_char(23,"What?");
 force_instant_terrain_redraw();
 pause(8);
 erase_text_bubbles();
 pause(3);
 text_bubble_on_char(23,"Adventurers?");
 force_instant_terrain_redraw();
 pause(8);
 erase_text_bubbles();
 pause(3);
 put_boom_on_char(23,2,0);
 run_animation();
 erase_char(23);
  play_sound(10);
   pause(4);
 set_flag(0,10,2);
 } break;
 
beginstate 12;
 if (get_flag(0,12) == 0){ message_dialog("Ahh, the jail. A place where thieves can have their attitude adjusted.","");
 set_flag(0,12,1);
 } break;
 
beginstate 13;
 if (get_flag(0,13) == 0){ message_dialog("Apparently the town isn't quite finished yet.","");
 set_flag(0,13,1);
 } break;
 
beginstate 14;
 if (get_flag(0,20) == 1){ message_dialog("The guard that had watched you kill the Darkling walks over to you.","_The captain needs to know of this right away! If only he would come out of his office!_");
 set_flag(0,20,2);
 } break;
 
beginstate 15;
 if (get_flag(0,20) == 2){ message_dialog("When you enter, someone, apparently the captain, yells suddenly.","When he calms down, he talks. _I'm sorry, they have locked me in here. Let us talk.");
 set_flag(0,20,3);
 } break;
 
beginstate 16; if (get_flag(0,22) == 5){ add_dialog_str(0,"There is a portal here, and you have the orb to stabilize it. Do you exit into the dark relm?",0); add_dialog_choice(0,"Stay"); add_dialog_choice(1,"Enter portal"); if (run_dialog(1) == 2) { play_sound(10); change_outdoor_location(2,1,42,5); move_to_new_town(5,16,13); }} break; 